package conf

import "fmt"

var drivers = make(map[string]Driver)

func Resigter(name string, driver Driver) {
	drivers[name] = driver
}

func GetDriver(name string) (Driver, error) {
	driveri, ok := drivers[name]
	if !ok {
		return nil, fmt.Errorf("conf: unknown driver %q ", name)
	}
	return driveri, nil
}
